<?php
	require_once('../libraryfiles/config.php');
	$content = 'updateUser.php';
	$include='<link rel="stylesheet" type="text/css" href="'.W_ROOT.'/css/mStyle.css">
			<script src="'.W_ROOT.'/js/jquery.js" type="text/javascript"></script>
		<script src="'.W_ROOT.'/js/jquery.validate.js" type="text/javascript"></script>';
	require_once TMP_USER_PATH;
	$start = '<span class="coloRed">*</span>';
	$error = isset($_GET['error'])?$_GET['error']:'';
?>
<?php
	$query= mysql_query("SELECT * FROM tbluser WHERE id=".$_GET['id'])or die(mysql_error());
	$data=dbFetchArray($query);
?>
<div id="eidtProductPrice">
	<div class="title">Edit an Account</div>
    
    <div class="center">
    	<form name="update" id="registerForm" method="post" enctype="multipart/form-data" action="registerProcess.php">
        	<input type="hidden" name="action" value="update_user" />
            <input type="hidden" name="id" value="<?php echo $data['id']?>"/>
        	<table style="margin-left:10px;" cellspacing="7">
            	<!--<tr height="10"><td></td></tr>-->
                <tr height="60">
                	<td colspan="3">
                    	<div style="float:left; width:300px;"><span style="color:#417EFB; font-size:18px;">Personal Information</span></div>
                    	<div style="float:right;"><span class="coloRed">Note : All (*) are required</span></div>
                    </td>
                </tr>
            	<!--<tr>
                	<td width="400"><span style="color:#417EFB; font-size:18px;">Personal Information</span></td>
                    <td></td>
                    <td><span class="coloRed">Note : All (*) are required</span></td>
                </tr>-->
                <tr>
                	<td>First Name<?php echo $start;?></td>
                    <td>:</td>
                    <td><input type="text" name="first_name" value="<?php echo $data['first_name']?>"/></td>
                </tr>
                <tr>
                	<td>Last Name<?php echo $start;?></td>
                    <td>:</td>
                    <td><input type="text" name="last_name" value="<?php echo $data['last_name']?>"/></td>
                </tr>
                <tr>
                	<td>Password<?php echo $start;?></td>
                    <td>:</td>
                    <td><input type="password" name="password" value="<?php echo $data['password']?>"/></td>
                </tr>
                <tr>
                	<td>Confirm Password<?php echo $start;?></td>
                    <td>:</td>
                    <td><input type="password" name="ConfirmPass" id="validate_cpass"/></td>
                </tr>
                <tr>
                	<td>Email<?php echo $start;?></td>
                    <td>:</td>
                    <td><input type="text" name="email" value="<?php echo $data['email']?>"/></td>
                </tr>
                <tr>
                	<td>Telephone<?php echo $start;?></td>
                    <td>:</td>
                    <td><input type="text" name="phone" value="<?php echo $data['phone']?>"/></td>
                </tr>
                <tr>
                	<td>Mobile</td>
                    <td>:</td>
                    <td><input type="text" name="mobile" value="<?php echo $data['mobile']?>"/></td>
                </tr>
                <tr>
                	<td>Address<?php echo $start;?></td>
                    <td>:</td>
                    <td><input type="text" name="address" value="<?php echo $data['address']?>"/></td>
                </tr>
                <tr>
                	<td>Country<?php echo $start;?></td>
                    <td>:</td>
                    <td>
                    	<select id="country" name="country">
                        	<?php
								$query="SELECT * FROM tblcountries ORDER BY country_name";
								$result = mysql_query($query);
								while($row = mysql_fetch_assoc($result)){
							?>
                            <option value="<?php echo $row['id'] ; ?>"><?php echo $row['country_name'] ; ?></option>
                            <?php
							}
							?>
                      	</select>
                    </td>
                </tr>
                 <tr height="60">
                	<td colspan="3">
                    	<div style="width:300px;"><span style="color:#417EFB; font-size:18px;">Pharmacy Information</span></div>
                    </td>
                </tr>
                <tr>
                	<td>Pharmacy Name<?php echo $start;?></td>
                    <td>:</td>
                    <td><input type="text" name="pharmacy_name" id="validate_pharmacy"/></td>
                </tr>
                <tr>
                	<td>Logo<?php echo $start;?></td>
                    <td>:</td>
                    <td>
                    	<!--<form action="#" method="post" enctype="multipart/form-data">
							<input type="file" name="image" id="file" />
							
						</form>-->
                        <input type="file" name="image" id="file" />
                     </td>
                </tr>
                <tr>
                	<td>Adress<?php echo $start;?></td>
                    <td>:</td>
                    <td><input type="text" name="pharmacy_address" id="validate_paddress"/></td>
                </tr>
                <tr>
                	<td>Location<?php echo $start;?></td>
                    <td>:</td>
                    <td>
                    	<select id="location" name="location">
                        	<?php
								$query="SELECT * FROM tbllocation ORDER BY location_name";
								$result=mysql_query($query);
								while($row=mysql_fetch_assoc($result)){
							?>
                            <option value="<?php echo $row['location_id']; ?>">
                            	<?php echo $row['location_name']; ?>
                            </option>
                            <?php } ?>
                        </select>
                    </td>
                </tr>
                 <tr>
                	<td>Phone<?php echo $start;?></td>
                    <td>:</td>
                    <td><input type="text" name="pharmacy_phone" id="validate_pphone"/></td>
                </tr>
                 <tr>
                	<td>Fax</td>
                    <td>:</td>
                    <td><input type="text" name="pharmacy_fax"/></td>
                </tr>
                 <tr>
                	<td>Email<?php echo $start;?></td>
                    <td>:</td>
                    <td><input type="text" name="pharmacy_email" id="validate_pemail"/></td>
                </tr>
                 <tr>
                	<td>Website</td>
                    <td>:</td>
                    <td><input type="text" name="pharmacy_website"/></td>
                </tr>
                <tr>
                	<td>License<?php echo $start;?></td>
                    <td>:</td>
                    <td><input type="text" name="pharmacy_license"/></td>
                </tr>
                <tr>
                	<td></td>
                    <td></td>
                    <td>
                    	Send newsletter?<input type="checkbox" name="newsletter" value="1" />	
                    </td>
                </tr>
                <tr>
                	<td></td>
                    <td></td>
                    <td>
                    	<input type="submit" name="edit" value="Edit" />
                    </td>
                </tr>
            </table>
        </form>
    </div>
</div>
